package com.hfy.music.mapper;

import com.hfy.model.po.music.MusicPo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

/**
 * @ author 韩
 * time: 2024/5/14 15:40
 */
@Mapper
public interface UploadMapper {

//    @Insert("INSERT INTO `music` (name, music, musician, createTime, albumId, cover) VALUES (#{name}, #{music}, #{musician}, #{createTime}, #{albumId}, #{cover})")
//    void uploadMusic(MusicPo upload);


    @Insert("INSERT INTO `music` (name, music, musician, createTime, albumId, cover,duration) VALUES (#{name}, #{music}, #{musician}, #{createTime}, #{albumId}, #{cover},#{duration})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    int uploadMusic(MusicPo upload);
    @Delete("DELETE FROM `music` where id = #{id}")
    boolean deleteTheRecord(Integer id);
}
